<html>
<head><meta charset="utf-8"><title>rebuild rustc with existing libstd/libcore · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html">rebuild rustc with existing libstd/libcore</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204286024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204286024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204286024">(Jul 18 2020 at 05:47)</a>:</h4>
<p>FWIW, another thing I'd love to see (not sure if it exists already) is a way to rebuild rustc but use it with an existing libstd/libcore - which isn't possible for all changes, but I think would be good enough to test small changes.</p>



<a name="204286090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204286090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204286090">(Jul 18 2020 at 05:49)</a>:</h4>
<p>I'm interested in both "build libstd/libcore, but only once, not every time I change anything in rustc" and "don't build libstd/libcore at all, just use the one from the rustup nightly".</p>



<a name="204286132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204286132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204286132">(Jul 18 2020 at 05:50)</a>:</h4>
<p>Again, I have limited experience with building rustc, so I don't know if this is possible already somehow.</p>



<a name="204286848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204286848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204286848">(Jul 18 2020 at 06:15)</a>:</h4>
<p><span class="user-mention" data-user-id="198590">@comex</span> I believe the path forward for stuff like that is your second point, more than the first. <span class="user-mention" data-user-id="116122">@simulacrum</span> and I have discussed it before, but idk if anyone has made any progress in allowing  the use of rustup nightly (or more realistically, last PR build)</p>



<a name="204286883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204286883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204286883">(Jul 18 2020 at 06:16)</a>:</h4>
<p>if you change something in <code>rustc</code>, it'd be unsound in general to use a stale core/std build</p>



<a name="204286905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204286905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204286905">(Jul 18 2020 at 06:16)</a>:</h4>
<p>I've recently observed some strange behavior arising from the fact that stage1-* doesn't get entirely nuked whenever I rebuild rustc</p>



<a name="204286906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204286906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204286906">(Jul 18 2020 at 06:16)</a>:</h4>
<p>I guess I should've filed an issue</p>



<a name="204286917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204286917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204286917">(Jul 18 2020 at 06:17)</a>:</h4>
<p>at best, it ICEs because of some incoherence. at worst, it generates broken code that behaves incorrectly at runtime</p>



<a name="204286992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204286992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204286992">(Jul 18 2020 at 06:19)</a>:</h4>
<p>Still, when the goal is to make the edit-compile-run cycle as fast as possible, and the change might be something as simple as "add a println somewhere"...</p>



<a name="204287035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287035">(Jul 18 2020 at 06:20)</a>:</h4>
<p>but it's like 40 seconds</p>



<a name="204287042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287042">(Jul 18 2020 at 06:20)</a>:</h4>
<p>maybe I'm still getting used to how fast building rustc is nowadays (with incremental), heh</p>



<a name="204287046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287046">(Jul 18 2020 at 06:21)</a>:</h4>
<p>Don't know.  I haven't built rustc very often :)</p>



<a name="204287048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287048">(Jul 18 2020 at 06:21)</a>:</h4>
<p>But I do work on Clang from time to time, and I'm used to Clang incremental builds being like 10-20 seconds total, and I think that's slow.</p>



<a name="204287049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287049">(Jul 18 2020 at 06:21)</a>:</h4>
<p>40 seconds is about the time it takes to build core/std from scratch, that is. maybe 2 minutes on less capable machines? not sure</p>



<a name="204287099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287099">(Jul 18 2020 at 06:22)</a>:</h4>
<p>and I tend to run everything through the entire test suite anyway, so it's not like the risks are worth the fraction that is taken up by core/std</p>



<a name="204287104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287104">(Jul 18 2020 at 06:22)</a>:</h4>
<p>Another thing...</p>



<a name="204287109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287109">(Jul 18 2020 at 06:23)</a>:</h4>
<p>I also want to be able to build rustc in debug mode, without the cost of building libcore/libstd with rustc in debug mode.</p>



<a name="204287118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287118">(Jul 18 2020 at 06:23)</a>:</h4>
<p>why? I don't know anyone who actually uses that except to debug maybe some "rustc calling into LLVM" failures</p>



<a name="204287158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287158">(Jul 18 2020 at 06:24)</a>:</h4>
<p>It's faster, isn't it?  (If the actual debug info level is held constant.  I just mean the optimization level.)</p>



<a name="204287177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287177">(Jul 18 2020 at 06:24)</a>:</h4>
<p>I mean using debug rustc. it's only there in case something really bad happens and there's no normal way to handle it</p>



<a name="204287183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287183">(Jul 18 2020 at 06:24)</a>:</h4>
<p>once we move to <code>tracing</code>, most of my gripes with the debug logging should go away, due to the hierarchical nesting information</p>



<a name="204287190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287190">(Jul 18 2020 at 06:25)</a>:</h4>
<p>there's just no way to get that kind of detail from using an actual debugger</p>



<a name="204287197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287197">(Jul 18 2020 at 06:25)</a>:</h4>
<p>not without us putting a lot of effort into integrating the rustc codebase with debuggers</p>



<a name="204287251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287251">(Jul 18 2020 at 06:26)</a>:</h4>
<p>Well.  My primary interest is not actually a debugger but just building in unoptimized mode.</p>



<a name="204287252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287252">(Jul 18 2020 at 06:26)</a>:</h4>
<p>it's not like LLVM where most stuff is fields and printable through a <code>-&gt;dump()</code> call or whatever</p>



<a name="204287256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287256">(Jul 18 2020 at 06:27)</a>:</h4>
<p>I'd love if Rust had a better debugger experience but that's another matter :)</p>



<a name="204287259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287259">(Jul 18 2020 at 06:27)</a>:</h4>
<p>it's not really about Rust, we're kind of limited by archaic tooling and don't have the bandwidth to develop our own</p>



<a name="204287266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287266">(Jul 18 2020 at 06:28)</a>:</h4>
<p><span class="user-mention" data-user-id="198590">@comex</span> oh, sorry, that's <code>optimize = false</code> not <code>debug = true</code> and even less requested</p>



<a name="204287298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287298">(Jul 18 2020 at 06:28)</a>:</h4>
<p>(in my opinion, traditional debuggers are fundamentally broken even for C++, since they can't instantiate functions at runtime.  Swift does this right.)</p>



<a name="204287300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287300">(Jul 18 2020 at 06:28)</a>:</h4>
<p>or talked about at all</p>



<a name="204287302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287302">(Jul 18 2020 at 06:28)</a>:</h4>
<p>does Swift have its own debugger?</p>



<a name="204287305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287305">(Jul 18 2020 at 06:28)</a>:</h4>
<p>or does it do something fancy by integrating lldb and swiftc?</p>



<a name="204287306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287306">(Jul 18 2020 at 06:28)</a>:</h4>
<p>The latter.</p>



<a name="204287314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287314">(Jul 18 2020 at 06:28)</a>:</h4>
<p>I am jealous now</p>



<a name="204287326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287326">(Jul 18 2020 at 06:29)</a>:</h4>
<p>but I guess I have previously suggested gdb/lldb could be connected up to miri somehow</p>



<a name="204287329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287329">(Jul 18 2020 at 06:29)</a>:</h4>
<p>so that no JITing would be necessary</p>



<a name="204287371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287371">(Jul 18 2020 at 06:30)</a>:</h4>
<p><span class="user-mention" data-user-id="198590">@comex</span> anyway in practice, it's not worth it. even if you bypass building core/std, anything you build will still be really slow</p>



<a name="204287383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287383">(Jul 18 2020 at 06:30)</a>:</h4>
<p>maybe <span class="user-mention" data-user-id="133247">@bjorn3</span> has good news regarding the cranelift backend, i.e. maybe it's less hopeless than LLVM</p>



<a name="204287393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287393">(Jul 18 2020 at 06:31)</a>:</h4>
<p>(there's also MIR optimizations we haven't finished/turned on by default, or even started working on, which could take up the slack)</p>



<a name="204287395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287395">(Jul 18 2020 at 06:31)</a>:</h4>
<p>Well, I don't know if the time spent just loading core makes this not worth it.  I did actually try this once, but I think I used <code>no_core</code> for the test case.</p>



<a name="204287400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287400">(Jul 18 2020 at 06:31)</a>:</h4>
<p>it'd be useful for like maybe one test case</p>



<a name="204287402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287402">(Jul 18 2020 at 06:31)</a>:</h4>
<p>But the thing I want to build in that case was a 10 line test case.</p>



<a name="204287449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287449">(Jul 18 2020 at 06:32)</a>:</h4>
<p>in general it takes more time to write a <code>#![no_core]</code> testcase than the extra time it takes to build the compiler with optimizations :P</p>



<a name="204287460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287460">(Jul 18 2020 at 06:32)</a>:</h4>
<p>Then it's still a win, because I only have to write the testcase once, but rebuild the compiler many times ;)</p>



<a name="204287472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287472">(Jul 18 2020 at 06:33)</a>:</h4>
<p>oh wait</p>



<a name="204287479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287479">(Jul 18 2020 at 06:33)</a>:</h4>
<p>if the test is <code>#![no_core]</code> you can just set <code>optimize = false</code> and just don't build core/std</p>



<a name="204287485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287485">(Jul 18 2020 at 06:33)</a>:</h4>
<p><code>./x.py build --stage 0 src/rustc</code> or something should be enough (the explicit <code>src/rustc</code> is to account for this MCP)</p>



<a name="204287526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287526">(Jul 18 2020 at 06:34)</a>:</h4>
<p>Yeah, I actually did do something like that.  I forget which command I used.  But I was hoping I could get a similar effect while still being able to use <code>core</code>, by reusing an existing built one.</p>



<a name="204287536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287536">(Jul 18 2020 at 06:34)</a>:</h4>
<p>But as I said, maybe it takes a long time just to load the serialized data or something; I haven't tried.</p>



<a name="204287537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287537">(Jul 18 2020 at 06:34)</a>:</h4>
<p>it's risky but I guess <code>--keep-std</code> could be offered as a non-broken version of <code>--keep-stage</code> (the latter which likes to break your build directory until you nuke most of it...)</p>



<a name="204287556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287556">(Jul 18 2020 at 06:35)</a>:</h4>
<p>it's mostly loaded on-demand, which actually matters, e.g. I remember cutting 4 seconds off the hello world compile time on raspberry pi lol</p>



<a name="204287596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287596">(Jul 18 2020 at 06:36)</a>:</h4>
<p>I see.  well, maybe "less broken" :)</p>



<a name="204287632"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287632" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287632">(Jul 18 2020 at 06:37)</a>:</h4>
<p>one of the reasons I'm opposed is you could gain minutes but lose hours if you touch one of many things that would actually result in a different core/std. I wish there was a way to tell if the only change between two builds is one has more debug logging <em>sigh</em></p>



<a name="204287674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> comex <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287674">(Jul 18 2020 at 06:38)</a>:</h4>
<p>Fair enough...</p>



<a name="204287692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204287692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204287692">(Jul 18 2020 at 06:39)</a>:</h4>
<p>but I guess if it warns that it's not rebuilding core/std and explains what could go wrong, every single time... it shouldn't be that bad</p>



<a name="204298106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204298106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204298106">(Jul 18 2020 at 12:06)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore/near/204287383">said</a>:</p>
<blockquote>
<p>maybe <span class="user-mention silent" data-user-id="133247">bjorn3</span> has good news regarding the cranelift backend, i.e. maybe it's less hopeless than LLVM</p>
</blockquote>
<p>Compile time is better, but runtime is slightly worse than even LLVM debug mode. Rustc is normally always built with optimizations, as it can then compile later stages much (up to 10x) faster.</p>



<a name="204298238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204298238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204298238">(Jul 18 2020 at 12:11)</a>:</h4>
<p>(deleted)</p>



<a name="204298288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204298288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204298288">(Jul 18 2020 at 12:12)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> alright, thanks for the clarification!</p>



<a name="204299355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204299355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204299355">(Jul 18 2020 at 12:46)</a>:</h4>
<blockquote>
<p>I'm interested in both "build libstd/libcore, but only once, not every time I change anything in rustc" and "don't build libstd/libcore at all, just use the one from the rustup nightly".</p>
</blockquote>
<p><span class="user-mention" data-user-id="198590">@comex</span> this is <code>build --stage 1 src/libstd --keep-stage 1</code>. But I've heard it might break things in the standard library.</p>



<a name="204299415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204299415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204299415">(Jul 18 2020 at 12:48)</a>:</h4>
<p>Oh whoops <span class="user-mention silent" data-user-id="119009">eddyb</span> already mentioned that</p>



<a name="204300874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204300874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204300874">(Jul 18 2020 at 13:35)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> looks like this topic is also orphaned from an MCP, idk where it belongs</p>



<a name="204300879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204300879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204300879">(Jul 18 2020 at 13:35)</a>:</h4>
<p>probably <a class="stream" data-stream-id="131828" href="/#narrow/stream/131828-t-compiler">#t-compiler</a> would be fine</p>



<a name="204300885"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204300885" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204300885">(Jul 18 2020 at 13:35)</a>:</h4>
<p>yeah that was my thought</p>



<a name="204300889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204300889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Notification Bot <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204300889">(Jul 18 2020 at 13:35)</a>:</h4>
<p>This topic was moved here from <a class="stream-topic" data-stream-id="233931" href="/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore">#t-compiler/major changes &gt; rebuild rustc with existing libstd/libcore</a> by <span class="user-mention silent" data-user-id="116122">simulacrum</span></p>



<a name="204300934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/rebuild%20rustc%20with%20existing%20libstd/libcore/near/204300934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/rebuild.20rustc.20with.20existing.20libstd.2Flibcore.html#204300934">(Jul 18 2020 at 13:36)</a>:</h4>
<p>thanks!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>